﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="managerFlight.aspx.cs" Inherits="managerFlight" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <%--<form id="form1" runat="server">--%>
        <div>
            <asp:Label ID="Label1" runat="server" Text="日期："></asp:Label>
            <asp:TextBox ID="日期" runat="server"></asp:TextBox>
&nbsp;<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" style="height: 21px" Text="选择日期" />
             &nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label2" runat="server" Text="出发地："></asp:Label>
            <asp:TextBox ID="出发地" runat="server"></asp:TextBox>
            &nbsp;<asp:Label ID="Label3" runat="server" Text="目的地："></asp:Label>
            <asp:TextBox ID="目的地" runat="server"></asp:TextBox>
            &nbsp;&nbsp;&nbsp;
            <asp:Button ID="foundflight" runat="server" OnClick="foundflight_Click" Text="查询" />
&nbsp;<div id="calendar" class="calendar"  runat="server">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Calendar ID="Calendar1" runat="server" visible="false" OnSelectionChanged="RequestedDeliveryDateCalendar_SelectionChanged" BackColor="White" BorderColor="#3366CC" BorderWidth="1px" CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="#003399" Height="200px" Width="200px" style="margin-left: 52px">
                <DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" />
                <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" />
                <OtherMonthDayStyle ForeColor="#999999" />
                <SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                <SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
                <TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px" Font-Bold="True" Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" />
                <TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
                <WeekendDayStyle BackColor="#CCCCFF" />
            </asp:Calendar>
                 </div> 
        </div>
        <asp:ListView ID="ListView1" runat="server" DataKeyNames="id" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="ListView1_SelectedIndexChanged" InsertItemPosition="LastItem" style="margin-right: 0px; height: 353px; width: 1600px;" EnablePersistedSelection="True">
            <AlternatingItemTemplate>
                <tr style="background-color: #FFFFFF;color: #284775;">
                    <td>
                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="删除" />
                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" />
                    </td>
                    <td>
                        <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                    </td>
                    <td>
                        <asp:Label ID="fly_nameLabel" runat="server" Text='<%# Eval("fly_name") %>' />
                    </td>
                    <td>
                        <asp:Label ID="typeLabel" runat="server" Text='<%# Eval("type") %>' />
                    </td>
                    <td>
                        <asp:Label ID="takeoff_timeLabel" runat="server" Text='<%# Eval("takeoff_time") %>' />
                    </td>
                    <td>
                        <asp:Label ID="land_timeLabel" runat="server" Text='<%# Eval("land_time") %>'/>
                    </td>
                    <td>
                        <asp:Label ID="start_placeLabel" runat="server" Text='<%# Eval("start_place") %>' />
                    </td>
                    <td>
                        <asp:Label ID="end_placeLabel" runat="server" Text='<%# Eval("end_place") %>' />
                    </td>
                    <td>
                        <asp:Label ID="economy_tickectLabel" runat="server" Text='<%# Eval("economy_tickect") %>' />
                    </td>
                    <td>
                        <asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price") %>' />
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <tr style="background-color: #999999;">
                    <td>
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="更新" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="取消" />
                    </td>
                    <td>
                        <asp:Label ID="idLabel1" runat="server" Text='<%# Eval("id") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="fly_nameTextBox" runat="server" Text='<%# Bind("fly_name") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="typeTextBox" runat="server" Text='<%# Bind("type") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="takeoff_timeTextBox" runat="server" Text='<%# Bind("takeoff_time") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="land_timeTextBox" runat="server" Text='<%# Bind("land_time") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="start_placeTextBox" runat="server" Text='<%# Bind("start_place") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="end_placeTextBox" runat="server" Text='<%# Bind("end_place") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="economy_tickectTextBox" runat="server" Text='<%# Bind("economy_tickect") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="priceTextBox" runat="server" Text='<%# Bind("price") %>' />
                    </td>
                </tr>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <table runat="server" style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                    <tr>
                        <td>未返回数据。</td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <tr style="">
                    <td>
                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="插入" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="清除" />
                    </td>
                    <td>&nbsp;</td>
                    <td>
                        <asp:TextBox ID="fly_nameTextBox" runat="server" Text='<%# Bind("fly_name") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="typeTextBox" runat="server" Text='<%# Bind("type") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="takeoff_timeTextBox" runat="server" Text='<%# Bind("takeoff_time") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="land_timeTextBox" runat="server" Text='<%# Bind("land_time") %>'/>
                    </td>
                    <td>
                        <asp:TextBox ID="start_placeTextBox" runat="server" Text='<%# Bind("start_place") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="end_placeTextBox" runat="server" Text='<%# Bind("end_place") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="economy_tickectTextBox" runat="server" Text='<%# Bind("economy_tickect") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="priceTextBox" runat="server" Text='<%# Bind("price") %>' />
                    </td>
                </tr>
            </InsertItemTemplate>
            <ItemTemplate>
                <tr style="background-color: #E0FFFF;color: #333333;">
                    <td>
                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="删除" />
                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" />
                    </td>
                    <td>
                        <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                    </td>
                    <td>
                        <asp:Label ID="fly_nameLabel" runat="server" Text='<%# Eval("fly_name") %>' />
                    </td>
                    <td>
                        <asp:Label ID="typeLabel" runat="server" Text='<%# Eval("type") %>' />
                    </td>
                    <td>
                        <asp:Label ID="takeoff_timeLabel" runat="server" Text='<%# Eval("takeoff_time") %>'/>
                    </td>
                    <td>
                        <asp:Label ID="land_timeLabel" runat="server" Text='<%# Eval("land_time") %>'/>
                    </td>
                    <td>
                        <asp:Label ID="start_placeLabel" runat="server" Text='<%# Eval("start_place") %>' />
                    </td>
                    <td>
                        <asp:Label ID="end_placeLabel" runat="server" Text='<%# Eval("end_place") %>' />
                    </td>
                    <td>
                        <asp:Label ID="economy_tickectLabel" runat="server" Text='<%# Eval("economy_tickect") %>' />
                    </td>
                    <td>
                        <asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price") %>' />
                    </td>
                </tr>
            </ItemTemplate>
            <LayoutTemplate>
                <table runat="server">
                    <tr runat="server">
                        <td runat="server">
                            <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                                <tr runat="server" style="background-color: #E0FFFF;color: #333333;">
                                    <th runat="server"></th>
                                    <th runat="server">id</th>
                                    <th runat="server">航班号</th>
                                    <th runat="server">机型</th>
                                    <th runat="server">起飞时间</th>
                                    <th runat="server">降落时间</th>
                                    <th runat="server">始发地</th>
                                    <th runat="server">目的地</th>
                                    <th runat="server">剩余票数</th>
                                    <th runat="server">单价</th>
                                </tr>
                                
                                <tr id="itemPlaceholder" runat="server">
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr runat="server">
                        <td runat="server" style="text-align: center;background-color: #5D7B9D;font-family: Verdana, Arial, Helvetica, sans-serif;color: #FFFFFF">
                            <asp:DataPager ID="DataPager1" runat="server">
                                <Fields>
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                    <asp:NumericPagerField />
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                </Fields>
                            </asp:DataPager>
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <tr style="background-color: #E2DED6;font-weight: bold;color: #333333;">
                    
                    <td>
                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="删除" />
                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" />
                    </td>
                    <td>
                        <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                    </td>
                    <td>
                        <asp:Label ID="fly_nameLabel" runat="server" Text='<%# Eval("fly_name") %>' />
                    </td>
                    <td>
                        <asp:Label ID="typeLabel" runat="server" Text='<%# Eval("type") %>' />
                    </td>
                    <td>
                        <asp:Label ID="takeoff_timeLabel" runat="server" Text='<%# Eval("takeoff_time") %>'/>
                    </td>
                    <td>
                        <asp:Label ID="land_timeLabel" runat="server" Text='<%# Eval("land_time") %>' />
                    </td>
                    <td>
                        <asp:Label ID="start_placeLabel" runat="server" Text='<%# Eval("start_place") %>' />
                    </td>
                    <td>
                        <asp:Label ID="end_placeLabel" runat="server" Text='<%# Eval("end_place") %>' />
                    </td>
                    <td>
                        <asp:Label ID="economy_tickectLabel" runat="server" Text='<%# Eval("economy_tickect") %>' />
                    </td>
                    <td>
                        <asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price") %>' />
                    </td>
                </tr>
            </SelectedItemTemplate>
        </asp:ListView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:crmConnectionString %>" SelectCommand="SELECT * FROM [flight]" DeleteCommand="DELETE FROM [flight] WHERE [id] = @id" InsertCommand="INSERT INTO [flight] ([fly_name], [type], [takeoff_time], [land_time], [start_place], [end_place], [economy_tickect], [price]) VALUES (@fly_name, @type, @takeoff_time, @land_time, @start_place, @end_place, @economy_tickect, @price)" UpdateCommand="UPDATE [flight] SET [fly_name] = @fly_name, [type] = @type, [takeoff_time] = @takeoff_time, [land_time] = @land_time, [start_place] = @start_place, [end_place] = @end_place, [economy_tickect] = @economy_tickect, [price] = @price WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="fly_name" Type="String" />
                <asp:Parameter Name="type" Type="String" />
                <asp:Parameter Name="takeoff_time" Type="DateTime" />
                <asp:Parameter Name="land_time" Type="DateTime" />
                <asp:Parameter Name="start_place" Type="String" />
                <asp:Parameter Name="end_place" Type="String" />
                <asp:Parameter Name="economy_tickect" Type="Int32" />
                <asp:Parameter Name="price" Type="Double" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="fly_name" Type="String" />
                <asp:Parameter Name="type" Type="String" />
                <asp:Parameter Name="takeoff_time" Type="DateTime" />
                <asp:Parameter Name="land_time" Type="DateTime" />
                <asp:Parameter Name="start_place" Type="String" />
                <asp:Parameter Name="end_place" Type="String" />
                <asp:Parameter Name="economy_tickect" Type="Int32" />
                <asp:Parameter Name="price" Type="Double" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    <%--</form>--%>
</asp:Content>
 